package com.OrderingServer.Controller.seller;


import com.OrderingServer.pojo.Systemlog;
import com.OrderingServer.service.ISystemlogService;
import com.OrderingServer.utils.Result;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

/**
 * <p>
 *  日志控制器
 * </p>
 * @author bruceliu
 * @since 2025-08-21
 */
@RestController
@RequestMapping("/sell/buyer/systemlog")
public class SystemlogController {

    @Autowired
    ISystemlogService systemlogService;

    /**
     * 分页条件查询
     */
    @ApiOperation(value = "查询订单分页", notes = "查询订单分页....")
    @GetMapping("selectPage")
    public Result selectPage(@RequestParam(defaultValue = "1") Integer pageNum,
                             @RequestParam(defaultValue = "10") Integer pageSize,
                             Systemlog systemlog) {
        PageInfo<Systemlog> pageInfo = systemlogService.selectPage(pageNum, pageSize, systemlog);
        return Result.success(pageInfo);
    }

    @ApiOperation("根据ID日志信息")
    @DeleteMapping("delete/{systemlogId}")
    public Result update(@ApiParam(value = "日志ID", required = true, example = "1") @PathVariable("systemlogId") Integer systemlogId) {
        return Result.success(systemlogService.removeById(systemlogId));
    }
}
